package com.remiss.seckilldemo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResposeBean {
    private long code;
    private String message;
    private Object object;

    public static  ResposeBean success(){
        return new ResposeBean(ResposeBeanEnum.SUCCESS.getCode(),ResposeBeanEnum.SUCCESS.getMessage(),null);
    }
    public static  ResposeBean success(Object object){
        return new ResposeBean(ResposeBeanEnum.SUCCESS.getCode(),ResposeBeanEnum.SUCCESS.getMessage(),object);
    }
    public static ResposeBean error(ResposeBeanEnum resposeBeanEnum){
        return  new ResposeBean(resposeBeanEnum.getCode(),resposeBeanEnum.getMessage(),null);
    }
    public static ResposeBean error(ResposeBeanEnum resposeBeanEnum,Object object){
        return  new ResposeBean(resposeBeanEnum.getCode(),resposeBeanEnum.getMessage(),object);
    }
}
